import request from '@/utils/request'

// 获取日志分页数据
export function getLogsByPage(params) {
  return request({
    url: '/logs/page',
    method: 'get',
    params
  })
}

// 获取今日统计
export function getTodayStats() {
  return request({
    url: '/logs/stats/today',
    method: 'get'
  })
}

// 获取用户最近日志
export function getRecentLogs(limit = 4) {
  return request({
    url: '/logs/recent',
    method: 'get',
    params: { limit }
  })
}

// 获取时间范围统计
export function getLogStatsByRange(startDate, endDate) {
  return request({
    url: '/logs/stats/range',
    method: 'get',
    params: { startDate, endDate }
  })
}

// 导出日志
export function exportLogs(params) {
  return request({
    url: '/logs/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 导出PDF日志
export function exportLogsPDF(params) {
  return request({
    url: '/logs/export/pdf',
    method: 'get',
    params,
    responseType: 'blob'
  })
} 